﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using DTO;

namespace DAO
{
   public class DonHangChuaGiaoDAO
    {
       public DataTable LoadDonHang()
       {
           DataTable dt = new DataTable();
           SqlConnection cn = DataProvider.ConnectionData();
           SqlCommand cmd = new SqlCommand("sp_DanhSachDonHangChuaGiao", cn);
           cmd.CommandType = CommandType.StoredProcedure;
           SqlDataAdapter adt = new SqlDataAdapter(cmd);
           adt.Fill(dt);
           cn.Close();
           return dt;

       
       }
       public void Update_DonHang(int MaHD)
       {
           SqlConnection cn = DataProvider.ConnectionData();
           string sql = "sp_GiaoHang";
           SqlCommand cmd = new SqlCommand(sql,cn);
           cmd.CommandType = CommandType.StoredProcedure;
           cmd.Parameters.Add("@maDH",MaHD);
           cmd.ExecuteNonQuery();
           cn.Close();
       }

    }
}
